﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Data;

namespace EIA.SLClient.ProjectManage.Basic
{
    public class QueryConditionPanelViewModel : SimpleMvvmToolkit.ViewModelBase<QueryConditionPanelViewModel>
    {

        protected string _ConsOrg;
        /// <summary>
        /// 建设单位
        /// </summary>
        public string ConsOrg
        {
            get { return _ConsOrg; }
            set
            {
                _ConsOrg = value;
                NotifyPropertyChanged(m => m.ConsOrg);
            }
        }

        protected DateTime? _WCSJ_0;
        /// <summary>
        /// 完成时间0
        /// </summary>
        public DateTime? WCSJ_0
        {
            get { return _WCSJ_0; }
            set
            {
                _WCSJ_0 = value;
                NotifyPropertyChanged(m => m.WCSJ_0);
            }
        }

        protected DateTime? _WCSJ_1;
        /// <summary>
        /// 完成时间1
        /// </summary>
        public DateTime? WCSJ_1
        {
            get { return _WCSJ_1; }
            set
            {
                _WCSJ_1 = value;
                NotifyPropertyChanged(m => m.WCSJ_1);
            }
        }

        protected DateTime? _CJSJ_0;
        /// <summary>
        /// 承接时间0
        /// </summary>
        public DateTime? CJSJ_0
        {
            get { return _CJSJ_0; }
            set
            {
                _CJSJ_0 = value;
                NotifyPropertyChanged(m => m.CJSJ_0);
            }
        }

        protected DateTime? _CJSJ_1;
        /// <summary>
        /// 承接时间1
        /// </summary>
        public DateTime? CJSJ_1
        {
            get { return _CJSJ_1; }
            set
            {
                _CJSJ_1 = value;
                NotifyPropertyChanged(m => m.CJSJ_1);
            }
        }

        protected PagedCollectionView _EngineerCollection;
        /// <summary>
        /// 工程师集合
        /// </summary>
        public PagedCollectionView EngineerCollection
        {
            get
            {
                if (_EngineerCollection == null && ListsResource.Instance.EngineerCollection != null)
                {
                    _EngineerCollection = new PagedCollectionView(ListsResource.Instance.EngineerCollection);
                    _EngineerCollection.Filter = (e) =>
                    {
                        return HYLX == null ? true : ((e as EIA.PM.Model.TEngineer).EngType == HYLX.DicIid);
                    };
                    NotifyPropertyChanged(m => m.EngineerCollection);
                }
                return _EngineerCollection;
            }
        }

        protected EIA.PM.Model.TEngineer _SelectedEngineer;
        /// <summary>
        /// 选择工程师
        /// </summary>
        public EIA.PM.Model.TEngineer SelectedEngineer
        {
            get { return _SelectedEngineer; }
            set
            {
                _SelectedEngineer = value;
                NotifyPropertyChanged(m => m.SelectedEngineer);
            }
        }

        protected EIA.Basic.Model.DicItem _XMLX;
        /// <summary>
        /// 项目类型
        /// </summary>
        public EIA.Basic.Model.DicItem XMLX
        {
            get { return _XMLX; }
            set
            {
                _XMLX = value;
                NotifyPropertyChanged(m => m.XMLX);
            }
        }

        protected EIA.Basic.Model.DicItem _XMJD;
        /// <summary>
        /// 项目进度
        /// </summary>
        public EIA.Basic.Model.DicItem XMJD
        {
            get { return _XMJD; }
            set
            {
                _XMJD = value;
                NotifyPropertyChanged(m => m.XMJD);
            }
        }

        protected EIA.Basic.Model.DicItem _XMLY;
        /// <summary>
        /// 项目来源
        /// </summary>
        public EIA.Basic.Model.DicItem XMLY
        {
            get { return _XMLY; }
            set
            {
                _XMLY = value;
                NotifyPropertyChanged(m => m.XMLY);
            }
        }

        protected EIA.Basic.Model.TStaff _XMFZR;
        /// <summary>
        /// 项目负责人
        /// </summary>
        public EIA.Basic.Model.TStaff XMFZR
        {
            get { return _XMFZR; }
            set
            {
                _XMFZR = value;
                NotifyPropertyChanged(m => m.XMFZR);
            }
        }

        protected EIA.Basic.Model.DicItem _HYLX;
        /// <summary>
        /// 行业类型
        /// </summary>
        public EIA.Basic.Model.DicItem HYLX
        {
            get { return _HYLX; }
            set
            {
                _HYLX = value;
                NotifyPropertyChanged(m => m.HYLX);
                if (EngineerCollection != null)
                {
                    EngineerCollection.Refresh();
                    SelectedEngineer = null;
                }
            }
        }

        protected EIA.Basic.Model.DicItem _KPZT;
        /// <summary>
        /// 开票状态
        /// </summary>
        public EIA.Basic.Model.DicItem KPZT
        {
            get { return _KPZT; }
            set
            {
                _KPZT = value;
                NotifyPropertyChanged(m => m.KPZT);
            }
        }

        protected EIA.Basic.Model.DicItem _DKZT;
        /// <summary>
        /// 到款情况
        /// </summary>
        public EIA.Basic.Model.DicItem DKZT
        {
            get { return _DKZT; }
            set
            {
                _DKZT = value;
                NotifyPropertyChanged(m => m.DKZT);
            }
        }

        protected EIA.Basic.Model.DicItem _HTZT;
        /// <summary>
        /// 合同状态
        /// </summary>
        public EIA.Basic.Model.DicItem HTZT
        {
            get { return _HTZT; }
            set
            {
                _HTZT = value;
                NotifyPropertyChanged(m => m.HTZT);
            }
        }

        protected EIA.Basic.Model.DicItem _HTQDZT;
        /// <summary>
        /// 合同签订主体
        /// </summary>
        public EIA.Basic.Model.DicItem HTQDZT
        {
            get { return _HTQDZT; }
            set
            {
                _HTQDZT = value;
                NotifyPropertyChanged(m => m.HTQDZT);
            }
        }

        protected EIA.Basic.Model.DicItem _XMSZD;
        /// <summary>
        /// 项目所在地
        /// </summary>
        public EIA.Basic.Model.DicItem XMSZD
        {
            get { return _XMSZD; }
            set
            {
                _XMSZD = value;
                NotifyPropertyChanged(m => m.XMSZD);
            }
        }

        protected EIA.Basic.Model.DicItem _XMSPBM;
        /// <summary>
        /// 项目审批部门
        /// </summary>
        public EIA.Basic.Model.DicItem XMSPBM
        {
            get { return _XMSPBM; }
            set
            {
                _XMSPBM = value;
                NotifyPropertyChanged(m => m.XMSPBM);
            }
        }
        
    }
}
